package tools

// Question 通用问题结构
type Question struct {
	ID          string   `json:"id"`
	Type        string   `json:"type"` // "single" | "multiple" | "free_text"
	Question    string   `json:"question"`
	Options     []string `json:"options,omitempty"`
	Placeholder string   `json:"placeholder,omitempty"`
}

// Answer 通用答案结构
type Answer struct {
	ID              string `json:"id"`
	Type            string `json:"type"`
	SelectedIndex   *int   `json:"selectedIndex,omitempty"`
	SelectedIndices []int  `json:"selectedIndices,omitempty"`
	Text            string `json:"text,omitempty"`
	AdditionalInput string `json:"additionalInput,omitempty"`
}

// SingleChoiceInput 单选题输入
type SingleChoiceInput struct {
	Question string   `json:"question"`
	Options  []string `json:"options"`
	Timeout  int      `json:"timeout,omitempty"`
}

// SingleChoiceOutput 单选题输出
type SingleChoiceOutput struct {
	SelectedIndex   int    `json:"selectedIndex"`
	SelectedOption  string `json:"selectedOption"`
	AdditionalInput string `json:"additionalInput,omitempty"`
	Cancelled       bool   `json:"cancelled"`
}

// MultipleChoiceInput 多选题输入
type MultipleChoiceInput struct {
	Question string   `json:"question"`
	Options  []string `json:"options"`
	Timeout  int      `json:"timeout,omitempty"`
}

// MultipleChoiceOutput 多选题输出
type MultipleChoiceOutput struct {
	SelectedIndices []int    `json:"selectedIndices"`
	SelectedOptions []string `json:"selectedOptions"`
	AdditionalInput string   `json:"additionalInput,omitempty"`
	Cancelled       bool     `json:"cancelled"`
}

// FreeTextInput 简答题输入
type FreeTextInput struct {
	Question    string `json:"question"`
	Placeholder string `json:"placeholder,omitempty"`
	Timeout     int    `json:"timeout,omitempty"`
}

// FreeTextOutput 简答题输出
type FreeTextOutput struct {
	Answer    string `json:"answer"`
	Cancelled bool   `json:"cancelled"`
}

// AskQuestionsInput 批量提问输入
type AskQuestionsInput struct {
	Questions []Question `json:"questions"`
	Timeout   int        `json:"timeout,omitempty"`
}

// AskQuestionsOutput 批量提问输出
type AskQuestionsOutput struct {
	Answers   []Answer `json:"answers"`
	Cancelled bool     `json:"cancelled"`
}
